/*
 * PACKAGE NAME: com.jodinfo.outmirror.implementation.offlanguagezhcn.service
 * FILE    NAME: OffLanguageZhCnDaoImpl.java
 * COPYRIGHT: Copyright(c) © 2016 heroj Company Ltd. All Rights Reserved
 */ 
package com.jodinfo.outmirror.service.impl;


import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jodinfo.outmirror.Exception.OffLanguageZhCnException;
import com.jodinfo.outmirror.dao.OffLanguageZhCnDao;
import com.jodinfo.outmirror.entity.OffLanguageZhCnEntity;
import com.jodinfo.outmirror.service.OffLanguageZhCnDmlService;

/**
 * OffLanguageZhCnDmlService实现
 * @author ZhangYuanYuan
 * @date 2016年12月30日 上午9:08:32
 * @version <b>1.0.0</b>
 */
@Service(value="offLanguageZhCnDmlService")
public class OffLanguageZhCnDmlServiceImpl implements OffLanguageZhCnDmlService {

 private static final Logger logger = LoggerFactory.getLogger(OffLanguageZhCnDmlServiceImpl.class);

 
	@Resource(name="offLanguageZhCnDao")
	private OffLanguageZhCnDao offLanguageZhCnDao;
	

	/** 
	 * 
	 * @author ZhangYuanYuan
	 * @date 2016年12月30日 上午9:15:36
	 * @see com.jodinfo.outmirror.implementation.offlanguagezhcn.OffLanguageZhCnDmlService#addOffLanguageZhCn(OffLanguageZhCnEntity offLanguageZhCnEntity)
	 * @param OffLanguageZhCnEntity offLanguageZhCnEntity
	 * @return int
	 */
	@Transactional(rollbackFor = Exception.class) 
	//@CacheEvict(allEntries=true,beforeInvocation=true)
	public int addOffLanguageZhCn(OffLanguageZhCnEntity offLanguageZhCnEntity) {
		int i = 0;
		try{
		//	i = offLanguageZhCnDao.add(offLanguageZhCnEntity);
		}catch(Exception e){
			logger.error(e.getMessage());
			//throw new OffLanguageZhCnException("OffLanguageZhCnEntity插入数据异常,",e.getMessage());
		}
		return i;
	}
	/** 
	 * 
	 * @author ZhangYuanYuan
	 * @date 2016年12月30日 上午9:15:36
	 * @see com.jodinfo.outmirror.implementation.offlanguagezhcn.OffLanguageZhCnDmlService#updateOffLanguageZhCn(OffLanguageZhCnEntity offLanguageZhCnEntity)
	 * @param OffLanguageZhCnEntity offLanguageZhCnEntity
	 * @return int
	 */
	@Transactional(rollbackFor = Exception.class)
	//@CacheEvict(allEntries=true,beforeInvocation=true)
	public int updateOffLanguageZhCn(OffLanguageZhCnEntity offLanguageZhCnEntity) {
	
		int i = 0;
		try{
			i =  offLanguageZhCnDao.update(offLanguageZhCnEntity);;
		}catch(Exception e){
			logger.error(e.getMessage());
			throw new OffLanguageZhCnException("OffLanguageZhCnEntity更新数据异常,"+e.getMessage());
		}
		return i;
	}
	
	/**
	 * 批量插入List<OffLanguageZhCnEntity> offLanguageZhCnEntityList
	 * @author shensu
	 * @date 2016年12月30日 上午9:11:48
	 * @param List<OffLanguageZhCnEntity> offLanguageZhCnEntityList
	 * @return int
	 */
	@Transactional(rollbackFor = Exception.class) 
//	@CacheEvict(allEntries=true,beforeInvocation=true)
	public int batchAddOffLanguageZhCn(List<OffLanguageZhCnEntity> offLanguageZhCnEntityList) {
		int i = 0;
		try{
			i =  offLanguageZhCnDao.adds(offLanguageZhCnEntityList);
		}catch(Exception e){
			logger.error(e.getMessage());
			throw new OffLanguageZhCnException("OffLanguageZhCnEntity更新数据异常,",e.getMessage());
		}
		return i;
	}
	
	/**
	 * 批量更新List<OffLanguageZhCnEntity> offLanguageZhCnEntityList
	 * @author shensu
	 * @date 2016年12月30日 上午9:11:48
	 * @param List<OffLanguageZhCnEntity> offLanguageZhCnEntityList
	 * @return int
	 */
	@Transactional(rollbackFor = Exception.class) 
	//@CacheEvict(allEntries=true,beforeInvocation=true)
	public int batchUpdateOffLanguageZhCn(List<OffLanguageZhCnEntity> offLanguageZhCnEntityList) {
		int i = 0;
		try{
		//	i =  offLanguageZhCnDao.updates(offLanguageZhCnEntityList);
		}catch(Exception e){
			logger.error(e.getMessage());
			//throw new OffLanguageZhCnException("OffLanguageZhCnEntity更新数据异常,",e.getMessage());
		}
		return i;
	}
	
}

